<template>
	<div>
		<DetailPage v-bind="BlockchainConfig" :pageRowData="{...nowRowData,onBlockchainFlag:1}" :model="baseInfo" style="width: 100%; margin: 0 auto" :onLoadFormate="onLoadFormate"> 
			<!-- 修改一下区域 -->
			<template #reservationTime="{row}">
				{{ nowRowData[row.prop] }}
			</template>
		</DetailPage>
	</div>
</template>

<script setup lang="ts">
import { getAreaObj } from '@/utils/util'
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { BlockchainConfig } from './config'
import apiMod from '@/apiMod/index'

const rowData: any = inject('nowRowData')

type Props = {
	nowRowData?:any,
	code?:number
}
let props = withDefaults(defineProps<Props>(),{
	nowRowData:{},
	code:3039
})

let baseInfo = ref({
	onBlockchainFlag:props.nowRowData.onBlockchainFlag
})
console.log('Shuju',props.nowRowData)


const getBaseInfo = () =>{
	console.log(props.nowRowData)
	let params = {
		"key":props.nowRowData.id,
		code:props.code
	}
	apiMod.view_blockchainBackupGeneral_queryBlockchainInfo(params).then(res=>{
		baseInfo.value = res.data
		baseInfo.value.onBlockchainFlag = 1
	})
}
getBaseInfo()



const onLoadFormate = (data) =>{
	data.cr_area_name = getAreaObj(data,'cr')
	const tableData = data
		return Promise.resolve(Object.freeze(tableData))
}
</script>

<style lang="scss" scoped>
.record_part {
	padding: vw(20);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
    .desc_part{
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        .prop_part{
            margin: 10px 0;
        }
    }
	.page_part {
		align-self: flex-end;
	}
}
.time_org{
    font-family: "Microsoft YaHei";
    font-weight: 400;
    font-size: 16px;
    text-align: left;
    color: #000;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    .org_name{
        padding: 2px 4px;
        height: 25px;
        border-radius: 4px;
        background: #FEF9EB;
        font-family: "Microsoft YaHei";
        font-weight: 400;
        font-size: 16px;
        text-align: center;
        color: #ecbb18;
        margin-left: 39px;
    }
}
.edit_user{
    font-family: "Microsoft YaHei Bold";
    font-weight: 700;
    font-size: 16px;
    text-align: left;
    color: #000000e6;
}
</style>
